import java.util.Scanner;


/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: syyyy
 * Date: 2025-07-22
 * Time: 14:24
 */

class Solution{
    public static void isDays(int year,int month,int day){
        int days=0;
        int[] dates=new int[]{31,28,31,30,31,30,31,31,30,31,30,31};

        if((year/4==0)&&(year/100!=0)){
            dates[1]=29;
        }

        if(month==1){
            days=day;
        }

        for (int i = 0; i < month-1; i++) {
            days=days+dates[i]+day;
        }

        System.out.println("这是一年中的第"+days+"天");

    }
}
public class Test2 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int year=scanner.nextInt();
        int month= scanner.nextInt();
        int day= scanner.nextInt();
        Solution.isDays(year,month,day);

    }
    public static void main1(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String s=scanner.next();
        char ch=s.charAt(0);

        if(!Character.isUpperCase(ch)){
            Character.toUpperCase(ch);
        }

    }
}
